<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get information from a RPM file</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.rpmdbsearch.html">« rpmdbsearch</a></li>
      <li style="float: right;"><a href="function.rpmvercmp.html">rpmvercmp »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.rpminfo.html">RpmInfo 函数</a></li>
    <li>Get information from a RPM file</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.rpminfo" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">rpminfo</h1>
  <p class="verinfo">(PECL rpminfo &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">rpminfo</span> &mdash; <span class="dc-title">Get information from a RPM file</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.rpminfo-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>rpminfo</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$full</code><span class="initializer"> = <strong><code>false</code></strong></span></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter reference">&$error</code><span class="initializer"> = ?</span></span>): <span class="type">array</span></div>

  <p class="para rdfs-comment">
   Retrieve information about a local file, a RPM package.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.rpminfo-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">path</code></dt>

    <dd>

     <p class="para">
      Path of the RPM file.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">full</code></dt>

    <dd>

     <p class="para">
      If <strong><code>true</code></strong> all information headers for the file are retrieved, else only a minimal set.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">error</code></dt>

    <dd>

     <p class="para">
      If provided, will receive the possible error message, and will avoid a runtime warning.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.rpminfo-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   An <span class="type">array</span> of information or NULL on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.rpminfo-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3189">
    <p><strong>示例 #1 A <span class="function"><strong>rpminfo()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />rpmaddtag</span><span style="color: #007700">(</span><span style="color: #0000BB">RPMTAG_BUILDTIME</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$info&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">rpminfo</span><span style="color: #007700">(</span><span style="color: #DD0000">"./php-pecl-rpminfo-0.4.2-1.el8.remi.7.4.x86_64.rpm"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [Name] =&gt; php-pecl-rpminfo
    [Version] =&gt; 0.4.2
    [Release] =&gt; 1.el8
    [Summary] =&gt; RPM information
    [Buildtime] =&gt; 1586244821
    [Arch] =&gt; x86_64
)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.rpminfo-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.rpmaddtag.html" class="function" rel="rdfs-seeAlso">rpmaddtag()</a> - Add tag retrieved in query</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>